<?php
require_once(dirname(__FILE__).'/config.php');
CheckPurview('plus_文件管理器');
$dsql->SetQuery("Select * From #@__arctype where reid=0 order by id asc");
	$dsql->Execute();
	while($row = $dsql->GetArray())
	{
	$langurl.="<a href='templets_main.php?acdir={$row['lang']}'>[ <u>{$row['typename']}</u> ]</a>"."&nbsp;&nbsp;&nbsp;&nbsp;";
	}


if(empty($acdir)){
$acdir = $cfg_df_style."/".$cfg_df_lang;
$templetdir = $cfg_basedir.$cfg_templets_dir;
$templetdird = $templetdir.'/'.$acdir;
$templeturld = $cfg_templeturl.'/'.$acdir;
}else{
	if($acdir=="plus"){
	$templetdir = $cfg_basedir.$cfg_templets_dir; //这个是templetes 目录
	$templetdird = $templetdir.'/'.$acdir; //默认模板 templetes/gb2312
	}else if($acdir !=''){
	$templetdir = $cfg_basedir.$cfg_templets_dir; //这个是templetes 目录
	$acdir=$cfg_df_style.'/'.$acdir;
	$templetdird = $templetdir.'/'.$acdir; //默认模板 templetes/gb2312
    }else{
		$templetdir = $cfg_basedir.$cfg_templets_dir;
$templetdird = $templetdir.'/'.$acdir;
$templeturld = $cfg_templeturl.'/'.$acdir;
	}

}

if(ereg("\.",$acdir))
{
	ShowMsg('Not Allow dir '.$acdir.'!','-1');
	exit();
}

function GetInfoArray($filename)
{
	$arrs = array();
	$dlist = file($filename);
	foreach($dlist as $d)
	{
		$d = trim($d);
		if($d!='')
		{
			list($dname,$info) = explode(',',$d);
			$arrs[$dname] = $info;
		}
	}
	return $arrs;
}

$dirlists  = GetInfoArray($templetdir.'/templet-dirlist.inc');
$filelists = GetInfoArray($templetdir.'/templet-filelist.inc');
$pluslists = GetInfoArray($templetdir.'/templet-pluslist.inc');
$fileinfos = ($acdir=='plus' ? $pluslists : $filelists);

include DedeInclude('templets/templets_default.htm');
?>